class Solution(object):
    def merge(self, nums1, m, nums2, n):
        """
        :type nums1: List[int]
        :type m: int
        :type nums2: List[int]
        :type n: int
        :rtype: None Do not return anything, modify nums1 in-place instead.
        """
        if m == len(nums1):
            nums1 = nums1 + nums2
        elif m == 0:
            nums1 = nums2
        elif m < len(nums1):
            count = len(nums1) - m
            while count > 0:
                del nums1[-1]
                count -= 1
            nums1 = nums1 + nums2
        else:
            nums1 = nums1

        return sorted(nums1)


if __name__ == '__main__':
    print(Solution().merge([1, 2, 3, 0, 0, 0], 3, [2, 5, 6], 3))
    print(Solution().merge(nums1 = [0], m = 0, nums2 = [1], n = 1))